package com.woniuxy.carlife.carlifeuserweb.mapper;

import com.woniuxy.carlife.carlifeusermodel.dto.UserCommentDto;
import com.woniuxy.carlife.carlifeuserweb.entity.UserInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author zjq
 * @ClassName:UserInfoMapper
 * @Description:用户详情
 * @date 2021/4/6 20:02
 **/

public interface UserInfoMapper extends BaseMapper<UserInfo> {

    /*
     * 功能描述〈用户评论详情〉
     * @author:zjq
     * @param:
     * @return:
     * @Date 2021/4/16 8:24
     * @throws
     */


    @Select("SELECT uI.user_info_image,uI.user_info_nickname,ucar.carbrand_name,ucar.carmodel_name FROM \n" +
            "t_user_info AS uI JOIN\n" +
            "t_usercar AS ucar\n" +
            "ON uI.user_id=ucar.user_id\n" +
            "WHERE uI.user_id=#{userId} AND ucar.usercar_default=1;")
    public UserCommentDto userConmmentByUserId(Integer userId);


}
